Partitioning schemes for quicksort and quickselect
نویسنده
چکیده
We introduce several modifications of the partitioning schemes used in Hoare’s quicksort and quickselect algorithms, including ternary schemes which identify keys less or greater than the pivot. We give estimates for the numbers of swaps made by each scheme. Our computational experiments indicate that ternary schemes allow quickselect to identify all keys equal to the selected key at little additional cost.
منابع مشابه
Optimal Sampling Strategies in Quicksort and Quickselect
It is well known that the performance of quicksort can be improved by selecting the median of a sample of elements as the pivot of each partitioning stage. For large samples the partitions are better, but the amount of additional comparisons and exchanges to find the median of the sample also increases. We show in this paper that the optimal sample size to minimize the average total cost of qui...
متن کاملQuickselect and Dickman function
We show that the limiting distribution of the number of comparisons used by Hoare’s quickselect algorithm when given a random permutation of n elements for finding the m-th smallest element, where m = o(n), is the Dickman function. The limiting distribution of the number of exchanges is also derived. 1 Quickselect Quickselect is one of the simplest and efficient algorithms in practice for findi...
متن کاملChunksort: A Generalized Partial Sorting Algorithm
We introduce here the problem of generalized partial sorting and chunksort, an algorithm closely related to quicksort and quickselect that solves this problem in an elegant and efficient way. In generalized partial sorting we are given an array of n elements and p intervals I1 = [`1,u1], I2 = [`2,u2], . . . , Ip = [`p,up], which define p blocks in the array and p+1 gaps between the blocks. The ...
متن کاملThe Number of Symbol Comparisons in QuickSort and QuickSelect
We revisit the classical QuickSort and QuickSelect algorithms, under a complexity model that fully takes into account the elementary comparisons between symbols composing the records to be processed. Our probabilistic models belong to a broad category of information sources that encompasses memoryless (i.e., independent-symbols) and Markov sources, as well as many unbounded-correlation sources....
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- CoRR
دوره cs.DS/0312054 شماره
صفحات -
تاریخ انتشار 2003